-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: hydratable
#17154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: hydratable
#17154
Conversation
🦋 Changeset detectedLatest commit: 3c36c7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
|
||
| ``` | ||
| Failed to retrieve `render` context. %addendum% | ||
| If `AsyncLocalStorage` is available, you're likely calling a function that needs access to the `render` context (`hydratable`, `cache`, or something that depends on these) from outside of `render`. If `AsyncLocalStorage` is not available, these functions must also be called synchronously from within `render` -- i.e. not after any `await`s. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we know, at the time we call e.render_context_unavailable, whether AsyncLocalStorage is available or not — can we incorporate that information into the addendum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is incorporated into the addendum -- I just couldn't dream up a way to be both helpful and put this much context into the addendum
packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys/_config.js
Outdated
Show resolved
Hide resolved
packages/svelte/tests/server-side-rendering/samples/hydratable-clobbering-but-ok/_config.js
Show resolved
Hide resolved
| title: Hydratable data | ||
| --- | ||
|
|
||
| In Svelte, when you want to render asynchonous content data on the server, you can simply `await` it. This is great! However, it comes with a pitall: when hydrating that content on the client, Svelte has to redo the asynchronous work, which blocks hydration for however long it takes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we mean pitfall here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep lol, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you wanna do an inline suggestion I'll accept it so you get cocontributor credit
Co-authored-by: kaysef <25851116+kaysef@users.noreply.github.com>
…elliott/hydratable
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint